/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.restaurant.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Dexter
 */
@Entity
@Table(name = "RestaurantRatings")
@NamedQueries({
    @NamedQuery(name = "RestaurantRatings.findAll", query = "SELECT o FROM RestaurantRatings o")})
public class RestaurantRatings implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "RestaurantRatingsId")
    private Long restaurantRatingsId;
    @Column(name = "Date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date date;
    @Column(name = "Message")
    private String message;
    @Column(name = "Quality")
    private Integer quality;
    @Column(name = "Speed")
    private Integer speed;
    @Column(name = "Price")
    private Integer price;
    @JoinColumn(name = "PersonId", referencedColumnName = "PersonId")
    @ManyToOne(fetch = FetchType.LAZY)
    private Persons personId;
    
    
    public RestaurantRatings() {
    }

    public RestaurantRatings(Long restaurantRatingsId) {
        this.restaurantRatingsId = restaurantRatingsId;
    }

    public Long getRestaurantRatingsId() {
        return restaurantRatingsId;
    }

    public void setRestaurantRatingsId(Long restaurantRatingsId) {
        this.restaurantRatingsId = restaurantRatingsId;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getQuality() {
        return quality;
    }

    public void setQuality(Integer quality) {
        this.quality = quality;
    }

    public Integer getSpeed() {
        return speed;
    }

    public void setSpeed(Integer speed) {
        this.speed = speed;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }
    
    public Persons getPersonId() {
        return personId;
    }

    public void setPersonId(Persons personId) {
        this.personId = personId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (restaurantRatingsId != null ? restaurantRatingsId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RestaurantRatings)) {
            return false;
        }
        RestaurantRatings other = (RestaurantRatings) object;
        if ((this.restaurantRatingsId == null && other.restaurantRatingsId != null) || (this.restaurantRatingsId != null && !this.restaurantRatingsId.equals(other.restaurantRatingsId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.entities.RestaurantRatings[ restaurantRatingsId=" + restaurantRatingsId + " ]";
    }
    
}
